package com.zosoft.responseResult;

/**
 * Created by 1553280431@qq.com on 2017/2/22.
 * 分页的查询参数VO
 */
public class PageableDTO {
    private int page = 1;//页码
    private int index = 0;//
    private int size = 15;//每页条目数
    private int total;//总条目数
    private int draw = 1;


    public PageableDTO(int index, int size) {
        this.index = index;
        if(size!=-1)this.size = size;
    }


    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getPageParams() {
        return index >= size ? ((index - (index % size)) / size + 1) : 1;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getDraw() {
        return draw;
    }

    public void setDraw(int draw) {
        this.draw = draw;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
